Stomping on local variables and trying to keep loop state isn't
too fun. Just use a new variable here so we aren't too confused
with what we're doing.
https://bugzilla.gnome.org/show_bug.cgi?id=719803
for (let j = 0; j < pendingLoad.callers.length; j++) {
if (pendingLoad.callers[j].onFinished) {
- if (content && pendingLoad.callers[j].shouldCopy) {
- content = object.copy(pendingLoad.callers[j].monitorIndex,
- pendingLoad.callers[j].effects);
+ let newContent;
+ if (content && pendingLoad.callers[j].shouldCopy) {
+ newContent = content.copy(pendingLoad.callers[j].monitorIndex,
+ pendingLoad.callers[j].effects);
+ } else {
+ newContent = content;
}
- pendingLoad.callers[j].onFinished(content);
+ pendingLoad.callers[j].onFinished(newContent);
}
}